import RentRoomsIndex from './rentRoomIndex'
import RentRoomsList from './rentRoomList'

const rentRoomRouter = {
  path: 'landlord/rentManage/rentRooms',
  getChildRoutes(location, cb) {
    require.ensure([], (require) => {
      cb(null, [
        {
          path: 'list',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./rentRoomList'))
            })
          },

        },
        // {
        //   path: 'roomSets',
        //   getComponents(nextState, cb) {
        //     require.ensure([], function (require) {
        //       cb(null, require('./rentRoomSets'))
        //     })
        //   }
        // },
        {
          path: 'roomSetsUpdate',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./rentRoomSetsModify'))
            })
          }
        },
        {
          path: 'collect',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./rentRoomsCollect'))
            })
          }
        },
        {
          path: 'history',
          getComponents(nextState, cb) {
            require.ensure([], function (require) {
              cb(null, require('./rentRoomsCollectHistory'))
            })
          }
        }
      ])
    })
  },

  indexRoute: {
    getComponents(location, cb) {
      require.ensure([], function (require) {
        cb(null, require('./rentRoomList'))
      })
      return cb()
    }
  },

  getComponents(nextState, cb) {
    require.ensure([], (require) => {
      cb(null, require('./rentRoomIndex'))
    })
  }
}

export default rentRoomRouter;

